package com.nine.service;

import com.nine.IService.CustomerService;
import com.nine.dao.CustomerDAO;
import com.nine.entity.Customer;

public class CustomerServiceImpl implements CustomerService{
	CustomerDAO customerDao;
	
	public CustomerDAO getCustomerDao() {
		return customerDao;
	}

	public void setCustomerDao(CustomerDAO customerDao) {
		this.customerDao = customerDao;
	}
	
	public boolean register(Customer c) {
		if(customerDao.save(c))
			return true;
		else
			return false;
	}

	public Customer findById(String id) {
		
		return customerDao.findById(id);
	}

	public Customer getCustomer(String id) {
		return customerDao.findById(id);
	}

	public int getPoint(String customerId) {
		return customerDao.findById(customerId).getPoint();
	}

	public boolean update(Customer customer) {
		return customerDao.update(customer);
	}

}
